/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.edu.amu.wmi.kino.visualjavafx.javafxcodegenerators.animation.transformations;

import pl.edu.amu.wmi.kino.visualjavafx.javafxcodegenerators.api.Generator;
import pl.edu.amu.wmi.kino.visualjavafx.javafxcodegenerators.helpergenerators.ColorVarsNameGenerator;
import pl.edu.amu.wmi.kino.visualjavafx.javafxcodegenerators.helpergenerators.FillGenerator;
import pl.edu.amu.wmi.kino.visualjavafx.model.animation.transformations.ChangeFillColor;

/**
 *
 * @author Admin
 */
public class ChangeFillColorGenerator implements Generator{

    @Override
    public boolean canGenerate(Object c) {
        if(c instanceof ChangeFillColor)
            return true;
        else return false;
    }

    @Override
    public void generate(StringBuilder sb, Object o,int recursionLevel,Object original) {
        ChangeFillColor c = (ChangeFillColor)o;
        String rName=ColorVarsNameGenerator.getR(FillGenerator.fill, recursionLevel);
        String gName=ColorVarsNameGenerator.getG(FillGenerator.fill, recursionLevel);
        String bName=ColorVarsNameGenerator.getB(FillGenerator.fill, recursionLevel);

        sb.append(rName+" => "+c.getDestinedColor().getRed()+" tween Interpolator." +
                     c.getInterpolation().getName()+",\n");
        sb.append(gName+" => "+c.getDestinedColor().getGreen()+" tween Interpolator." +
                     c.getInterpolation().getName()+",\n");
        sb.append(bName+" => "+c.getDestinedColor().getBlue()+" tween Interpolator." +
                     c.getInterpolation().getName()+",\n");
    }

}
